package com.zsw.service.impl;

import com.zsw.dao.CommodityDao;
import com.zsw.entity.Commodity;
import com.zsw.service.CommodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author zhangsw
 */
@Service
public class CommodityServiceImpl implements CommodityService {

    @Resource
    private CommodityDao commodityDao;

    @Override
    public Integer addCommodity(Commodity commodity) {
        return commodityDao.insertCommodity(commodity);
    }

    @Override
    public Commodity getCommodityById(Integer id) {
        return commodityDao.selectCommodityById(id);
    }
}
